package cn.sytton.taffe.web.sys.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Schema(description = "权限菜单树")
@Data
public class AuthMenuTree {

    public AuthMenuTree(MenuEntity entity) {
        this.id = entity.getMenuId();
        this.parentId = entity.getParentId();
        this.label = entity.getMenuName();
    }

    @Schema(description = "菜单ID")
    private String id;

    @Schema(description = "菜单父ID")
    private String parentId;

    @Schema(description = "菜单名称")
    private String label;

    @Schema(description = "是否已勾选")
    private boolean checked = false;

    @Schema(description = "勾选的不确定状态")
    private boolean indeterminate = false;

    @Schema(description = "下级节点数组")
    private List<AuthMenuTree> children = new ArrayList<>();

    @Schema(description = "菜单功能项数组")
    private List<AuthFuncKey> funcKeys = new ArrayList<>();

    @Schema(description = "菜单编号")
    private String menuCode;

    @Schema(description = "菜单路由")
    private String route;

    @Schema(description = "图标")
    private String iconClass;

    //todo 确认前端什么作用
    @Schema(description = "是否隐藏")
    private int hiddenRoute = 0;
}
